package TreeDayShuZu.Exercise;

import java.util.Scanner;

public class Exercise02 {
    public static void main(String[] args) {
        //用一个数组存储本组学员的姓名，先从键盘输入小组人数，再从键盘输入每一个学员的姓名，然后遍历显示
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入小组人数");
        int count=scanner.nextInt();
        //声明数组保存小组的姓名
        String[]name=new String[count];
        for (int i = 0; i < name.length ; i++) {
            System.out.println("请输入"+(i+1)+"个同学的姓名");
            name[i]=scanner.next();
        }
        System.out.println("完成之后显示的结果");
        for (int i = 0; i <name.length ; i++) {
            System.out.print(name[i]+" ");
        }
    }
}
